<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0"/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>MCU MANAGER</title>
	<%@ include file="/WEB-INF/jsp/common/cssjs2.jsp" %>
	
	<script type="text/javascript">
		$(function(){
			$('.easyui-validatebox').validatebox();
			$('.easyui-validatebox[required]').after("<font color='red'> *</font>");
		});
		
		function doSubmit(){
			$('#id_form').form('submit', {
		        url:"<c:url value='/app/setup/mcu/config'/>",
		        onSubmit: function(){
		        	if($('.easyui-validatebox').validatebox("isValid")==false){
		        		return false;
		        	}else{
						return true;
					}
		        },
		        success:function(data){
					if("<fmt:message key="operation.success"/>" != data)
						alert(data);
					parent.closeWin();
		        }
			});
		}
		
		function reboot(){
			if(confirm("<fmt:message key='common.cofirm.reboot' />")){
				$.ajax({
					url:"<c:url value='/app/setup/reboot'/>",
					type:"GET",
					data:{
						times:new Date().valueOf()
					},
					success:function(data){
						alert("<fmt:message key='common.tip.afterReboot' />");
						parent.closeWin();
					}
				});
			}
		}
	</script>
	
	<style type="text/css">
	    html, body,form {
	        width: 100%;
	        height: 100%;
	        margin: 0px;
	        overflow: hidden;
	    }
	</style>
</head>
<body class="dialog">
<form id="id_form" method="post">
<input type="hidden" value="PUT" name="_method" />
<table border="0" style="width:100%;text-align:left;font-size:12px;margin:5px;" cellpadding="3" cellspacing="0">
	<tbody>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.h245portbase'/></td>
			<td width="70%"><input type="text" name="h245portbase" value="${model.h245portbase}" class="easyui-validatebox" required="true"  validtype="digit"/>(1024-65534)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.h245portmax'/></td>
			<td width="70%"><input type="text" name="h245portmax" value="${model.h245portmax}" class="easyui-validatebox" required="true"  validtype="digit"/>(1024-65534)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.minport'/></td>
			<td width="70%"><input type="text" name="minport" value="${model.minport}" class="easyui-validatebox" required="true" validtype="positiveInt"/>(1024-65534)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.maxport'/></td>
			<td width="70%"><input type="text" name="maxport" value="${model.maxport}" class="easyui-validatebox" required="true" validtype="positiveInt"/>(1024-65534)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.audioDSCP'/></td>
			<td width="70%"><input type="text" name="audioDSCP" value="${model.audioDSCP}" class="easyui-validatebox" required="true" validtype="digit"/>(0-63)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.videoDSCP'/></td>
			<td width="70%"><input type="text" name="videoDSCP" value="${model.videoDSCP}" class="easyui-validatebox" required="true" validtype="digit"/>(0-63)</td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.called'/></td>
			<td width="70%"><input type="text" name="called" value="${model.called}" class="easyui-validatebox" validtype="positiveInt" /></td>
		</tr>
		<tr>
			<td width="30%"><fmt:message key='setup.mcu.config.prefix'/></td>
			<td width="70%"><input type="text" name="prefix" value="${model.prefix}"/></td>
		</tr>
		<tr>
			<td colspan="2">
				<p style="color:red;">
				<fmt:message key="common.tip" /> : <fmt:message key="common.tip.reboot" />
				</p>
				<p>
                <input type="button" onclick="doSubmit();" class="mybtn" value="<fmt:message key='btn.ok'/>">
				<button onclick="reboot();" class="mybtn"><fmt:message key='btn.reboot'/></button>
				<button onclick="parent.closeWin();" class="mybtn"><fmt:message key='btn.cancel'/></button>
				</p>
			</td>
		</tr>
	</tbody>
</table>
</form>
</body>
</html>